
#pragma once
#include <Windows.h>
#include <vector>
#include <list>
#include <set>
#include <map>

#pragma warning(disable:4018)	//有符号/无符号不匹配
#pragma warning(disable:4244)	//从float转换到int，可能丢失数据
#pragma warning(disable:4996)	//function or variable may be unsafe

//utility.cpp
struct wstrless_t
{
	bool operator()(const WCHAR* a, const WCHAR* b) const
	{
		return wcscmp(a,b)<0;
	}
};

bool wstrless(WCHAR* s1,WCHAR* s2);
WCHAR* wstrdup(WCHAR* wstr);
void wstrfree(WCHAR* wstr);
BOOL wstreql(WCHAR* wstr1,WCHAR* wstr2);
int Mul1000(float Value);

int GenerateId();
BOOL PointInRect(int X,int Y,int Left,int Top,int Width,int Height);
void SetImmBoxPosition(HWND hWnd,int X,int Y);
int GetImmResultString(HWND hWnd,WCHAR* ImmBuf,int BufLen);
void CopyTextToClipboard(HWND hWnd,WCHAR* Text,int Len);
void PasteTextFromClipboard(HWND hWnd,WCHAR* Buffer,int MaxBufLen);

extern const int WinViewWidth;
extern const int WinViewHeight;
extern const int UpdateTime;

extern HWND hWndMain;

class GDirect2dManager;
class GResourceManager;
class GUIManager;
extern GDirect2dManager* D2dMgr;
extern GResourceManager* ResMgr;
extern GUIManager* UiMgr;

//misc.cpp
enum ImageRType
{
	IT_None,
	IT_Bitmap,
	IT_Scale9,
	IT_Animation,
};

struct ImageR_t;
class CButton;
class CImage;
class CLabel;
class CLineLabel;
class CCheckBox;
class CVScrollView;
class CEdit;
class CSpListBox;
class CDropList;
class CHSlider;
class CHTabView;
class UIControl;

ImageR_t* EasyGetImageR(int ResId,ImageRType Type=IT_Bitmap);
void SetCreateControlParam(int X,int Y,UIControl* Parent,int PageId);
CButton* EasyCreateButton(int CtrlId,int Width,int Height,WCHAR* Text);
CButton* EasyCreateFlatButton(int CtrlId,int Width,int Height,WCHAR* Text);
CImage* EasyCreateImage(int CtrlId,int Width,int Height,int ResId=-1,ImageRType Type=IT_Bitmap);
CLabel* EasyCreateLabel(int CtrlId,int Width,int Height,WCHAR* Text);
CLineLabel* EasyCreateLineLabel(int CtrlId,int Width,int Height,WCHAR* Text);
CCheckBox* EasyCreateCheckBox(int CtrlId,WCHAR* Text);
CVScrollView* EasyCreateScrollView(int CtrlId,int Width,int Height,int VirtualHeight);
CEdit* EasyCreateEdit(int CtrlId,int Width);
CSpListBox* EasyCreateSpListBox(int CtrlId,int Width,int Height);
CDropList* EasyCreateDropList(int CtrlId,int Width,BOOL IconStyle);
CHSlider* EasyCreateSlider(int CtrlId,int Width);
CHTabView* EasyCreateTabView(int CtrlId,int Width,int Height);



